function HandleAUser(gui, user, date, options, data) {
  this._gui = gui;
  this._user = user;
  this._date = date;
  this._options = options;
  this._data = data;
  
  this._popupBox = new ModulePopupBox();
  this._createElements();
};

HandleAUser.prototype._createElements = function() {
  var tr, td, _self = this;

  if (this._data[0] && this._data[0].data.length != 0) {
    this._u = this._data[0].data[0];
  } else {
    this._u = pz_user.instance();
  }
  
  this._gui.type.options[this._gui.type.options.length] = new Option('-');
  for (var i = 0, il = UserType.array().length; i < il; i++) {
    var type = UserType.array()[i];
    if (type == Constant.USER_TYPE_ADMINISTER) {
      continue;
    }
    option = new Option(type);
    this._gui.type.options[this._gui.type.options.length] = option;
    if (option.text == this._u.type) {
      this._gui.type.selectedIndex = this._gui.type.options.length - 1;
    }
  }
  
  this._gui.akl.checked = (this._u.is_akl == 1) ? true : false;
  this._gui.syd.checked = (this._u.is_syd == 1) ? true : false;
  this._gui.mel.checked = (this._u.is_mel == 1) ? true : false;
  this._gui.xtrao.checked = (this._u.is_xtrao == 1) ? true : false;
  this._gui.nyc.checked = (this._u.is_nyc == 1) ? true : false;
  this._gui.bne.checked = (this._u.is_bne == 1) ? true : false;
  
  this._gui.akl.onchange = function() { if (this.checked) { _self._u.is_akl = 1; } else { _self._u.is_akl = 0; } };
  this._gui.syd.onchange = function() { if (this.checked) { _self._u.is_syd = 1; } else { _self._u.is_syd = 0; } };
  this._gui.mel.onchange = function() { if (this.checked) { _self._u.is_mel = 1; } else { _self._u.is_mel = 0; } };
  this._gui.xtrao.onchange = function() { if (this.checked) { _self._u.is_xtrao = 1; } else { _self._u.is_xtrao = 0; } };
  this._gui.nyc.onchange = function() { if (this.checked) { _self._u.is_nyc = 1; } else { _self._u.is_nyc = 0; } };
  this._gui.bne.onchange = function() { if (this.checked) { _self._u.is_bne = 1; } else { _self._u.is_bne = 0; } };
  
  this._gui.account.value = this._u.account;
  this._gui.email.value = this._u.email;
  this._gui.name.value = this._u.name;
  this._gui.password.value = this._u.password;
  
  this._gui.account.onchange = function() { _self._u.account = this.value; };
  this._gui.email.onchange = function() { _self._u.email = this.value; };
  this._gui.name.onchange = function() { _self._u.name = this.value; };
  this._gui.password.onchange = function() { _self._u.password = this.value; };
  this._gui.type.onchange = function() { _self._u.type = this.options[this.selectedIndex].text; };
  
  this._gui.save.onclick = function() { var str = '';
                                        if (_self._u.account == '') {
                                          str += 'Account, ';
                                        }
                                        if (_self._u.password == '') {
                                          str += 'Password, ';
                                        }
                                        if (_self._u.name == '') {
                                          str += 'Name, ';
                                        }
                                        if (_self._u.type == '') {
                                          str += 'Type, ';
                                        }
                                        if (_self._u.account == '' || _self._u.password == '' || _self._u.type == '') {
                                          window.alert(str.substring(0, str.length-2) + ' Can Not Be Empty');
                                        } else {
                                          var pos = DOMUtils.findPos(this);
                                          new RequestUtils()._write('pz_user', [_self._u], [], function() {history.back(); }, {pos: pos});
                                        }
                                      };
  this._gui.cancel.onclick = function() { history.back(); };
};
